////
////  OSSViewController.swift
////  TTProduct-macOS
////
////  Created by Toj on 4/15/21.
////
//
//import Cocoa
//
//class OSSViewController: TTViewController {
//
//    private lazy var button: NSButton = {
//        let view = NSButton()
//        return view
//    }()
//    
//    var oss: TTOSS?
//    var aResource: OSSResource?
//    override func viewDidLoad() {
//        super.viewDidLoad()
//        
//        let resource = OSSResource()
//        aResource = resource
//        resource.serverUrl = "https://portal.vipcode.com/api/common/v1.0/getSecurityToken"
//       
//        resource.endpoint = "oss-cn-beijing.aliyuncs.com"
//        resource.accessKey = "LTAIHghSOQkNxDlA"
//        resource.secretKey = "Twy7f7FoAFKmU1E26IuryrJg3j2bH5"
//        resource.bucketName = "vipcode-client"
//        resource.keyPath = "log/test/toj.txt"
//        // resource.ossFileName = "vcEditer.zip"
//        resource.token = ""
//        resource.expiration = ""
//        
//        resource.fromURL = ""
//        resource.toURL = ""
//        
//        view.addSubview(button)
//        button.snp.makeConstraints { (make) in
//            make.bottom.equalTo(view.snp.bottom).offset(-100)
//            make.left.height.width.equalTo(100)
//        }
//
//        button.target = self
//        button.action = #selector(self.didTapButton)
//        button.wantsLayer = true
//        button.layer?.backgroundColor = NSColor.red.cgColor
//    }
//    
//    @objc private func didTapButton() {
//        print(className + " : " + #function)
//        guard let resource = aResource else {
//            return
//        }
//        let from = "/Users/vipcode/Desktop/vcEditer.zip"
//        let to = "/Users/vipcode/Desktop/tt/tttt/vcEditer"
//        
//        oss = TTOSS(resource: resource)
////        oss?.upload(from: from) { (a, b, c) in
////            print(a)
////            print(b)
////            print(c)
////        } completed: { (isSuccess, info) in
////            print(isSuccess)
////            print(info)
////        }
//        oss?.download(to: to, progress: { (write, totalWrite, total) in
//            print(write)
//            print(totalWrite)
//            print(total)
//        }, completed: { (isSuccess, data, info) in
//            print(isSuccess)
//            print(data?.count ?? 0)
//            print(info)
//        })
//    }
//}
